$(() => {
});

function submit(cb = $.noop) {
    let description = $("#description").val();
    let name = $("#name").val();


    //前端校验：js校验
    if (name.trim() === "") {
        layer.msg("姓名不可为空");
        return;
    }


    $.ajax({
        url: ctx + "/admin/subject/add",
        method: "post",
        data: {
            name,
            description
        },
        success(resp) {
            cb(resp.success);
        }
    });


}